Skip to content

Conversation

@filiphr
Copy link
Contributor

@filiphr filiphr commented Nov 4, 2025

Seems like that since the integration to use the new Elasticsearch Rest5Client was done in #46061 and from version 9.2.0 Elasticsearch is now also delivering a dedicated co.elastic.clients:elasticsearch-rest5-client.

With this PR I am adding that client to the managed dependencies and I have made the Java client co.elastic.clients:elasticsearch-java an optional dependency.

I believe that this is similar to how it was in Spring Boot 3 and similar to 4.0.0-M1.

@filiphr filiphr force-pushed the elasticsearch-rest5-client branch from e1c36ab to dd3389a Compare November 4, 2025 21:21
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 4, 2025
@wilkinsona wilkinsona self-assigned this Nov 5, 2025
@wilkinsona wilkinsona changed the title Use elasticsearch-rest5-client in spring-boot-elasticsearch Use Elasticsearch 9.2's elasticsearch-rest5-client in spring-boot-elasticsearch Nov 5, 2025
@wilkinsona wilkinsona added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 5, 2025
@wilkinsona wilkinsona modified the milestones: 4.0.x, 4.0.0-RC2 Nov 5, 2025
wilkinsona pushed a commit that referenced this pull request Nov 5, 2025
@wilkinsona wilkinsona closed this in ec7724f Nov 5, 2025
@wilkinsona
Copy link
Member

Thanks very much, @filiphr.

@filiphr filiphr deleted the elasticsearch-rest5-client branch November 5, 2025 10:10
@anbusampath
Copy link
Contributor

elasticsearch-rest5-client doesn't transitively pull elasticsearch-java. So spring-boot-elasticsearch module alone can't be used without adding elasticsearch-java. I also believe that this low level client created to keep clients compatible with Elasticsearch version 8 and below to support latest Apache client 5. elastic/elasticsearch-java#1064image

@filiphr
Copy link
Contributor Author

filiphr commented Nov 15, 2025

Hey @anbusampath, when I did this I didn't realize that there is now a spring-boot-starter-elasticsearch. The PR I did was for spring-boot-elasticsearch and to align that to how it was in Spring Boot 3. In Spring Boot 3 it was possible to only configure the low level Elasticsearch Rest Client, i.e. there was only spring-boot-starter-data-elasticsearch which brought the high level elastic-java dependency through spring-data-elasticsearch dependency.

In any case, in my opinion spring-boot-elasticsearch should not enforce the elasticsearch-java dependency on everyone. However, I do believe that it is OK for spring-boot-starter-elasticsearch to be a bit more opinionated and pull the elasticsearch-java dependency. I created #48141 for this. @wilkinsona, I'll leave it up to you and the Spring Boot team to decide whether the starter should be more opinionated or not.

@anbusampath
Copy link
Contributor

However, I do believe that it is OK for spring-boot-starter-elasticsearch to be a bit more opinionated and pull the elasticsearch-java dependency.

This makes more sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

type: enhancement A general enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants